package com.macoli.android_test;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.TextView;

import com.macoli.command_exec.ExecuteResult;
import com.macoli.command_exec.LocalCommandExecutorImpl;

public class MainActivity extends AppCompatActivity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState) ;
        setContentView(R.layout.activity_main) ;


        findViewById(R.id.cmd_btn).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                ExecuteResult result = new LocalCommandExecutorImpl().executeCommand("ls /sdcard/" , 5000) ;
                Log.d("gggl" , result.getExecuteOut()) ;

                ((TextView)findViewById(R.id.result_tv)).setText(result.getExecuteOut());
            }
        });


    }

}